package ch.ffhs.ks.ui;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import ch.ffhs.ks.model.ModelContext;
import ch.ffhs.ks.storage.StorageManager;

public class Starter {

	/**
	 * @param args
	 * @throws UnsupportedLookAndFeelException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws ClassNotFoundException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
				
		System.setProperty("apple.laf.useScreenMenuBar", "true");
		
		StorageManager storageManager = new StorageManager();
		ModelContext modelContext = new ModelContext(storageManager);
		
		MainWindow mainWindow = new MainWindow(modelContext);

		
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		
		mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mainWindow.setVisible(true);
	
		modelContext.loadConfiguration();
		
	}

}
